{extend name="Public/public"}
{block name="title"}用户列表{/block}
{block name="main"}
<style>
  form{
    float:left;
  }
</style>
  <div class="col-xs-12"> 
   <div class="table-responsive"> 
    <form action="/user/index" method="get">
      <label><input type="text"  name="keywords"placeholder="请输入用户名"/></label>
      <input type="submit" value="查询"class="btn-info ">
       &nbsp; &nbsp; &nbsp;
     </form>

      <form action="/user/index" method="get">
      <label> <input type="text"  name="phone"placeholder="请输入手机号码"/></label>
      <input type="submit" value="查询"class="btn-info ">
      &nbsp;&nbsp;&nbsp;
     </form>
     <form action="/user/index" method="get">
      <label> <select name="static" id="">
        <option value="1">启用</option>
        <option value="2">禁用</option>
      </select></label>
      <input type="submit" value="查询"class="btn-info ">
      &nbsp;&nbsp;&nbsp;
     </form>

    <table id="sample-table-1" class="table table-striped table-bordered table-hover"> 
     <thead> 
      <tr> 
       
       <th>选中</th> 
       <th>用户名</th> 
       <th class="hidden-480">真实姓名</th> 
       <th class="hidden-480">所属组</th> 
       <th class="hidden-480">手机号</th> 
       <th class="hidden-480">邮箱</th> 
       <th class="hidden-480">注册时间</th> 
       <th class="hidden-480">上次登录</th> 
       <th class="hidden-480">状态</th> 
       <th> <i class="icon-time bigger-110 hidden-480"></i>操作</th> 
      </tr> 
     </thead> 
     <tbody> 
      {foreach name="list" item="row"}
      <tr> 
      <form action="/user/delete"method="post">
       <td><input type="checkbox" value="{$row.id}"name="{$row.id}"></td> 
       <td>{$row.username}</td>
       <td>{$row.name}</td> 
       <td>{foreach name="data" item="rows"}
            {if condition="$row.details eq $rows.details"}
            {$rows.name}
            {/if}
            {/foreach}

       </td>
       <td>{$row.phone}</td>
       <td>{$row.mail}</td>
       <td>{$row.reg|date="Y-m-d H:i:s",###}</td>
       <td>{$row.login|date="Y-m-d H:i:s",###}</td>
       <td>
         {switch name="$row.static"}
         {case value="1"}启用{/case}
         {case value='2'}<div style="color:red">禁用</div>{/case}
         {/switch}
       </td>
       <td> 
        <a href="/user/edit/id/{$row.id}">修改</a>
        <a href="/user/login/id/{$row.id}">登入</a>
       </td> 
      </tr> 

      {/foreach}

 
      
      
     </tbody> 


    </table> 
 

  <input type="submit" value="删除"class="btn-danger">
  </form>
  <button onclick="select(true)"class="btn-warning">全选</button>
  <button onclick="select(false)"class="btn-success">全不选</button>
     <aside class="paging">
       {$list->render()}
      </aside>
   </div>
   <!-- /.table-responsive --> 
  </div>

  <script>
  var inputs = document.getElementsByTagName('input');
  //全选和全不选函数
  function select(mask){
    //alert(mask);
    for(var i=0;i<inputs.length;i++){
      inputs[i].checked=mask;
    }
  }


  
    
  
</script>
{/block}
